package com.slipper.sfts.stock.front;

import com.slipper.common.bo.Result;
import com.slipper.common.util.ResultUtil;
import com.slipper.sfts.api.stock.bo.StockOrderBO;
import com.slipper.sfts.api.stock.service.IStockOrderSv;
import com.slipper.sfts.stock.service.StockOrderService;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class StockOrderSv implements IStockOrderSv {
    @Resource
    private StockOrderService stockOrderService;
    
    @Override
    public Result<StockOrderBO> queryBy(String id) {
        return ResultUtil.successResult(stockOrderService.queryBy(id));
    }

    @Override
    public Result<List<StockOrderBO>> queryList(StockOrderBO bo) {
        return ResultUtil.successResult(stockOrderService.queryList(bo));
    }
    
    @Override
    public Result<List<StockOrderBO>> queryPage(StockOrderBO bo) {
        return ResultUtil.successResult(stockOrderService.queryPage(bo));
    }
    
    @Override
    public Result<?> save(StockOrderBO bo) {
        return ResultUtil.saveResult(stockOrderService.save(bo), bo);
    }
    
    @Override
    public Result<?> delete(StockOrderBO bo) {
        return ResultUtil.deleteResult(stockOrderService.delete(bo));
    }
}
